﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace CommTest
{
    public partial class XBeeBoard : Form
    {
        MainForm.SDataStructure lastData;

        public XBeeBoard()
        {
            InitializeComponent();
        }

        public void NewData(MainForm.SDataStructure copyStruct)
        {
            lastData = copyStruct;
        }

        private void timerGUI_Tick(object sender, EventArgs e)
        {
            // update GUI
            textBoxLoop.Text = string.Format("{0:f3} ms", lastData.XBeeLoop);
            textBoxLoopMAX.Text = string.Format("{0:f3} ms", lastData.XBeeLoopMAX);
            textBoxTimeTotal.Text = string.Format("{0:f2} s", lastData.XBeeTotalTime);
        }
    }
}
